package com.ebolib.base;
import android.os.Bundle;
import android.view.View;


public abstract class MVPBaseActivity<T extends BasePresenter, M extends BaseModel> extends MySimpleActivity {
    public T mPresenter;
    public M mModel;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        mPresenter = CreateUtil.getT(this,0);
        mModel = CreateUtil.getT(this,1);
        mPresenter.attachModelView(mModel,this);
    }

    public void initViews() {

    }

    @Override
    public void onClick(View view) {

    }

    @Override
    protected void onDestroy() {
        super.onDestroy();

        if (mPresenter != null) {
            mPresenter.onDone();//在presenter中解绑释放view
            mPresenter = null;
        }
    }
    public abstract void initView();

}
